package utils 
{
	import net.flashpunk.Sfx;
	
	/**
	 * ...
	 * @author Matt Hofmann
	 */
	public class SoundBoard
	{
		// Singleton instance of SoundBoard
		private static var instance:SoundBoard = new SoundBoard();
		
		// Load sound effects, prefix with sfx*
		[Embed(source = "../../assets/sfx/Naruto_jump_air.mp3")] private const JUMP1:Class;
		public var sfxJump1:Sfx = new Sfx(JUMP1);
		[Embed(source = "../../assets/sfx/Naruto_jump_air2.mp3")] private const JUMP2:Class;
		public var sfxJump2:Sfx = new Sfx(JUMP2);
		[Embed(source = "../../assets/sfx/Naruto_jump_air3.mp3")] private const TELEPORT:Class;
		public var sfxTeleport:Sfx = new Sfx(TELEPORT);
		[Embed(source="../../assets/sfx/Naruto_landed_tiny.mp3")] private const LANDING:Class;
		public var sfxLanding:Sfx = new Sfx(LANDING);
		[Embed(source = "../../assets/sfx/chaa.mp3")] private const CHAA:Class;
		public var sfxChaa:Sfx = new Sfx(CHAA);
		[Embed(source = "../../assets/sfx/gahhh.mp3")] private const GAHH:Class;
		public var sfxGahh:Sfx = new Sfx(GAHH);
		[Embed(source = "../../assets/sfx/hei-punch.mp3")] private const HEI:Class;
		public var sfxHei:Sfx = new Sfx(HEI);
		[Embed(source = "../../assets/sfx/rasengan.mp3")] private const RASENGAN:Class;
		public var sfxRasengan:Sfx = new Sfx(RASENGAN);
		[Embed(source = "../../assets/sfx/kage_bunshin.mp3")] private const KAGE_BUNSHIN:Class;
		public var sfxKageBunshin:Sfx = new Sfx(KAGE_BUNSHIN);
		[Embed(source = "../../assets/sfx/Naruto_bunshin_seal.mp3")] private const SEAL:Class;
		public var sfxSeal:Sfx = new Sfx(SEAL);
		[Embed(source = "../../assets/sfx/ngh.mp3")] private const NGH1:Class;
		public var sfxNgh1:Sfx = new Sfx(NGH1);
		[Embed(source = "../../assets/sfx/ngh2.mp3")] private const NGH2:Class;
		public var sfxNgh2:Sfx = new Sfx(NGH2);
		[Embed(source = "../../assets/sfx/swoosh.mp3")] private const THROW1:Class;
		public var sfxThrow1:Sfx = new Sfx(THROW1);
		[Embed(source = "../../assets/sfx/swoosh2.mp3")] private const THROW2:Class;
		public var sfxThrow2:Sfx = new Sfx(THROW2);
		[Embed(source = "../../assets/sfx/kunai_cling2.mp3")] private const KUNAI_CLING:Class;
		public var sfxKunaiCling:Sfx = new Sfx(KUNAI_CLING);
		[Embed(source = "../../assets/sfx/poof.mp3")] private const POOF1:Class;
		public var sfxPoof1:Sfx = new Sfx(POOF1);
		[Embed(source = "../../assets/sfx/poof2.mp3")] private const POOF2:Class;
		public var sfxPoof2:Sfx = new Sfx(POOF2);
		
		// Load music, prefix with mus*
		[Embed(source = "../../assets/sfx/Battle 3.mp3")] private const SONG1:Class;
		public var musSong1:Sfx = new Sfx(SONG1);
		
		public function SoundBoard() 
		{
			
		}	
		
		public static function get i():SoundBoard
		{
			return instance;
		}
		
		public function playSound(snd:Sfx, vol:Number = 1, pan:Number = 0, loop:Boolean = false):void {
			snd.stop();
			if (loop) {
				snd.loop(vol, pan);
			}
			else {
				snd.play(vol, pan);
			}
		}
	}

}